.switch {
    --dark: #404045;
    --light: #EEEEEE;
    position: relative;
    display: inline-block;
    border-radius: 1rem;
    cursor: pointer;
    width: 60px;
    height: 30px;
    overflow: hidden;
  }
  
  .checkbox {
    opacity: 0
  }
  
  .slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark);
    transition: .4s;
  }
  
  .slider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 50%;
    height: 100%;
    border-radius: 100%;
    transform: translateY(-50%);
    border: 4px solid var(--dark);
    background-color: var(--light);
    transition: .4s;
  }
  
  .slider::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    border-radius: 100%;
    transform: translate(40%, -20%);
    background-color: var(--dark);
    transition: .4s;
  }
  
  .checkbox:checked + .slider {
    background-color: var(--light);
  }
  
  .checkbox:checked + .slider::before {
    border: 4px solid var(--light);
    background-color: var(--dark);
    transform: translate(100%, -50%);
  }
  
  .checkbox:checked + .slider::after {
    width: 0;
    height: 0;
    background-color: var(--light);
  }